﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class SelectListCollectionExtensions
    {
        public static bool Exists(this SelectListCollection selectListCollection, string selectListIdOrNameOrValueorClass, bool extension = true)
        {
            return selectListCollection.Exists(Find.ById(selectListIdOrNameOrValueorClass)) ||
                selectListCollection.Exists(Find.ByName(selectListIdOrNameOrValueorClass)) ||
                selectListCollection.Exists(Find.ByValue(selectListIdOrNameOrValueorClass)) ||
                selectListCollection.Exists(Find.ByClass(selectListIdOrNameOrValueorClass)) ||
                selectListCollection.Exists(Find.ByLabelText(selectListIdOrNameOrValueorClass));
        }
    }
}